/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: nu uc
 * License Type: Evaluation
 */
package org.testis.orm.classes;

import org.orm.*;

public class T_bed_networkserialconfiguration {
    public T_bed_networkserialconfiguration() {
    }

    public boolean save() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .saveObject(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public boolean delete() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .deleteObject(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public boolean refresh() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .getSession().refresh(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public boolean evict() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .getSession().evict(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    private int id;

    private String configName;

    private String ip;

    private String port;

    private void setId(int value) {
	this.id = value;
    }

    public int getId() {
	return id;
    }

    public int getORMID() {
	return getId();
    }

    public void setConfigName(String value) {
	this.configName = value;
    }

    public String getConfigName() {
	return configName;
    }

    public void setIp(String value) {
	this.ip = value;
    }

    public String getIp() {
	return ip;
    }

    public void setPort(String value) {
	this.port = value;
    }

    public String getPort() {
	return port;
    }

    public String toString() {
	return toString(false);
    }

    public String toString(boolean idOnly) {
	if (idOnly) {
	    return String.valueOf(getId());
	} else {
	    StringBuffer sb = new StringBuffer();
	    sb.append("T_bed_networkserialconfiguration[ ");
	    sb.append("Id=").append(getId()).append(" ");
	    sb.append("ConfigName=").append(getConfigName()).append(" ");
	    sb.append("Ip=").append(getIp()).append(" ");
	    sb.append("Port=").append(getPort()).append(" ");
	    sb.append("]");
	    return sb.toString();
	}
    }

}
